#! /bin/sh
source /etc/profile
source /root/.bash_profile
workdir=$(cd $(dirname $0); pwd)
jarname=tomp-1.0-SNAPSHOT.jar
echo "${jarname} stop..."

ps -fe|grep ${jarname} |grep -v grep
pro_id=`ps -fe|grep ${jarname} |grep -v grep | awk '{print $2}'`
if [[ ${pro_id} != "" ]]
then
kill -9 ${pro_id}
echo "${jarname} has been stopped."
else
echo "${jarname} is stopped."
fi

echo "start ${jarname} process....."
cd $workdir
java -jar  ${jarname} >> ./logs/start.log 2>&1 &
